package com.caiheng.api.entity.product;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.json.JSONArray;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 商品规则值(规格)对象 product_rule
 *
 * @author ruoyi
 * @date 2021-08-13
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName(value = "product_rule",autoResultMap = true)
public class ProductRule implements Serializable {

    private static final long serialVersionUID=1L;


    /**
     * $column.columnComment
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    /**
     * 规格名称
     */
    private String ruleName;

    /**
     * 规格值
     */
    private String ruleValue;


	/** 规格值 */
	@TableField(exist = false)
	private JSONArray ruleValueArray;

    private Integer isDel;

    private Integer cateChildId;

	public void copy(ProductRule source){
		BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
	}
}
